package cn.mill.core.utils;

import java.util.ServiceLoader;

import cn.mill.common.annotation.SPI;

public class SpiUtil {
	public static SPI getSPIAnnotation(Object object) {
		if (object != null) {
			return object.getClass().getAnnotation(SPI.class);
		}
		return null;
	}
	
	public static <T> ServiceLoader<T> loadSPI(Class<T> service) {
		return ServiceLoader.load(service);
	}
}
